--- co-product
package frege.data.Coproduct where

data  Coproduct (f ∷ * → *) (g ∷ * → *) a = Inl (f a) | Inr (g a)

instance (Functor f, Functor g) => Functor (Coproduct f g) where
  fmap f (Inl fa) = Inl (fmap f fa)
  fmap f (Inr ga) = Inr (fmap f ga)
